-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: remove neutral section hacks to improve reliability #7413
Conversation
ff8cb0c
to
efbb6da
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #7413 +/- ##
=============================================
+ Coverage 18.79% 29.44% +10.64%
+ Complexity 2016 2012 -4
=============================================
Files 903 1162 +259
Lines 114916 143499 +28583
Branches 2809 2808 -1
=============================================
+ Hits 21594 42247 +20653
- Misses 91668 99594 +7926
- Partials 1654 1658 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot 🧹
The current implementation of neutral ranges has at least two troublesome hacks: - when leaving a neutral section, the train takes time to start drawing power again. due to the design of the current implementation, this time is converted into an approximate distance - power is cut ahead of time using an announce zone, instead of having the driver react to the signal. this zone is there regardless of routes These hacks bring about several bugs: - the length of neutral section is extended by an approximation of the distance required to start drawing power again. This approximation is always too high if the train is slowing down. If the train is slowing down to a stop, it can get stuck in this approximated extension. This issue will vanish once this gets simulated over time instead. - if a train stops inside the neutral section announce zone, it has to start drawing power anyway to start back up, then cut power in the neutral section. this behavior is very hard to emulate with the current simulation engine. - if a sign announces a neutral section just before a switch, the announce zone is directional. getting this right probably means treating annonce signs as signals, and treat those as route dependant. This is a lot of work, and needs to wait until trains can react to signals (train sim v3). These hacks were a bad idea in the first place, and the features they were meant to implement will be a lot easier to implement once trains: - are simulated in a causal way - can react to signals
efbb6da
to
be21975
Compare
The current implementation of neutral ranges has at least two troublesome hacks:
due to the design of the current implementation, this time is converted into an
approximate distance
react to the signal. this zone is there regardless of routes
These hacks bring about several bugs:
required to start drawing power again. This approximation is always too high
if the train is slowing down. If the train is slowing down to a stop, it can
get stuck in this approximated extension. This issue will vanish once this
gets simulated over time instead.
drawing power anyway to start back up, then cut power in the neutral section.
this behavior is very hard to emulate with the current simulation engine.
is directional. getting this right probably means treating annonce signs as
signals, and treat those as route dependant. This is a lot of work, and needs
to wait until trains can react to signals (train sim v3).
These hacks were a bad idea in the first place, and the features they were meant
to implement will be a lot easier to implement once trains: